#include "Player.h"
#include "Array"


Player::Player()
{
	this->isAlive = true;
}
Player::~Player()
{

}

bool Player::init()
{
	bool b = false;
	do 
	{

		

		b = true;
	} while (0);
	return b;
}
Player* Player::create()
{
	Player* pRet = new Player();
	if(pRet && pRet->init())
	{
		return pRet;
	}
	else
	{
		delete pRet;
		return NULL;
	}
}


bool Player::insertNewSkill(Skill* skill)
{
	if(NULL == skill)
		return false;
	if(this->m_SkillHead == NULL)
	{
		m_SkillHead = new SkillList;
		m_SkillRear = m_SkillHead;
		m_SkillHead->prev = NULL;
		m_SkillHead->next = NULL;
		m_SkillHead->skill = skill;
		return;
	}

	SkillList* p = NULL;
	SkillList* q = NULL;

	



	return true;
}
bool Player::enabelSkill(int tag)
{
	if(!this->checkTag(tag))
		return false;

	return true;
}
bool Player::checkTag(int tag)
{
	for(SkillList* i = this->m_SkillHead; i->next != NULL; i = i->next)
	{
		if(tag == i->skill->getTag())
		{
			break;
		}
		return false;
	}
	return true;
}


///////////////   get set

bool Player::getAliveStatus()
{
	return this->isAlive;
}
void Player::setAliveStatus(bool isAlive)
{
	this->isAlive = isAlive;
}


int Player::getHP()
{
	return this->HP;
}
void Player::updateHP(int HP)
{
	this->HP += HP;
}

int Player::getMP()
{
	return this->MP;
}
void Player::updateMP(int MP)
{
	this->MP += MP;
}

int Player::getLevel()
{
	return this->level;
}
void Player::updateLevel(int level)
{
	this->level += level;
}

int Player::getExperience()
{
	return this->experienceValue;
}
void Player::updateExperience(int experienceValue)
{
	this->experienceValue += experienceValue;
}

int Player::getAssets()
{
	return this->assets;
}
void Player::updateAssets(int asstes)
{
	this->assets += asstes;
}

//////////////////////////  action



bool Player::initSprite(const char* filepath)
{
	bool b = false;
	do 
	{

		this->sprite = CCSprite::create(filepath);

		b = true;
	} while (0);
	return b;
}

void Player::SaySomething(const char* words)
{	
	label->setString(words);
}


